home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9817 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  790 b 

  1. Path: peer-news.britain.eu.net!strath-cs!abrown
  2. From: abrown@cs.strath.ac.uk (Andrew Brown)
  3. Newsgroups: comp.lang.c
  4. Subject: Pointer to int
  5. Date: 13 Mar 1996 19:17:03 GMT
  6. Organization: Computer Science Dept., Strathclyde University., Glasgow, Scotland.
  7. Sender: abrown@cs.strath.ac.uk (Andrew G Brown CES92)
  8. Distribution: world
  9. Message-ID: <4i76vf$58v@dunlop.cs.strath.ac.uk>
  10. NNTP-Posting-Host: muir-01.cs.strath.ac.uk
  11.  
  12. I have a function that takes as a parameter a pointer to an int. Is it 
  13. possible to pass the address of a constant directly to the function?
  14.  
  15. eg. 
  16.   
  17. If the function is defined as ...
  18.  
  19.   int function( int * ptr );
  20.  
  21. could I call it with something like ...
  22.  
  23.   x = function( &1000 );
  24.  
  25. where 1000 is the constant to which I want ptr to reference.
  26.  
  27. Many thanks
  28.  
  29. Andrew Brown.
  30.